#include "../include/Common.hh"
#include <iostream>

using namespace std;

// Screen clearing functionality implementation
void Utility::clearScreen() {
#ifdef _WIN32
    system("cls");
#else
    system("clear");
#endif
}

// Pause functionality implementation
void Utility::pause() {
    std::cout << "\nPress Enter to continue...";
    std::cin.ignore();
    std::cin.get();
    Utility::clearScreen() ;
}

// Input validation implementation
int Utility::getIntInput(int min, int max) {
    int choice;
    while (true) {
        std::cin >> choice;
        if (std::cin.fail() || choice < min || choice > max) {
            std::cin.clear();
            std::cin.ignore(1024, '\n');
            std::cout << "Invalid input, please re-enter (" << min << "-" << max << "):";
        } else {
            break;
        }
    }
    return choice;
}

